﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<script type="text/javascript">
    var curr = '未分供应商';
    var col1 = [
                { label: '序号', name: '', width: 80, align: 'center' },
                { label: '备件编号', name: '', width: 80, align: 'center' },
                { label: '备件名称', name: '', width: 80, align: 'center' },
                { label: '备件分类', name: '', width: 80, align: 'center' }
    ];
    var col2 = [
                { label: '序号', name: '', width: 80, align: 'center' },
                { label: '备件编号', name: '', width: 80, align: 'center' },
                { label: '备件名称', name: '', width: 80, align: 'center' },
                { label: '制造单位', name: '', width: 80, align: 'center' },
                { label: '制造单位名称', name: '', width: 120, align: 'center' },
                { label: '备件分类', name: '', width: 80, align: 'center' }
    ];
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        var myLayout = $('#layout').layout({ resizable: false });
        $('select').bindSelect();
        $('.category').on("click", function () {
            //alert($(this).attr('checked'))
            var aa = $("input[type='radio'].category:checked").val();
            if (curr == aa) {
                return;
            } else {
                curr = aa;
            }
            if (aa == '未分供应商') {
                showList1();
            } else {
                showList2();
            }
        })
    }
    function gridList() {
        var $gridList1 = $("#gridList1");
        $gridList1.dataGrid({
            //url: "/SystemManage/User/GetGridJson",
            height: $(window).height() - 280,
            colModel: col1,
            pager: "#gridPager1",
            sortname: 'F_DepartmentId asc,F_CreatorTime desc',
            viewrecords: true
        });
        var $gridList2 = $("#gridList2");
        $gridList2.dataGrid({
            //url: "/SystemManage/User/GetGridJson",
            height: $(window).height() - 280,
            colModel: col2,
            pager: "#gridPager2",
            sortname: 'F_DepartmentId asc,F_CreatorTime desc',
            viewrecords: true
        });
        showList1();
    }

    function showList1() {
        $("#grid111").show();
        $("#grid222").hide();
    }
    function showList2() {
        $("#grid111").hide();
        $("#grid222").show();
    }
    function btn_ok() {
        parent.$.detailClose();
    }
    function btn_cancel() {
        parent.$.detailClose();
    }
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="ui-layout-center">
        <form id="form1">
            <div style="width:950px;margin:0 auto;">
                <table class="form" style="width:900px;text-align:right;margin:15px;border-bottom:2px solid #ccc;">
                    <tr>
                        <td class="formValue input-width-185" style="width:500px;padding-left:100px;text-align:left;">
                            &nbsp;
                        </td>
                        <td style="width: 300px; padding: 5px 10px;">
                            <div class="btn-group" style="margin-right:20px;">
                                <a id="" class="btn btn-primary center-block" onclick="btn_ok()"><span class="glyphicon glyphicon-ok"></span> 确认</a>
                            </div>
                            <div class="btn-group">
                                <a id="" class="btn btn-primary center-block" onclick="btn_cancel()"><span class="glyphicon glyphicon-remove"></span> 取消</a>
                            </div>
                        </td>
                    </tr>
                </table>
                <table class="form" style="width: 900px;">
                    <tr>
                        <th class="formTitle">供货单位</th>
                        <td class="formValue input-width-320">
                            <select id="" name="" class="form-control"></select>
                        </td>
                        <th class="formTitle">供货描述</th>
                        <td class="formValue input-width-320">
                            <input id="" type="text" class="form-control required" value="" />
                        </td>
                    </tr>
                </table>
                <div class="line-table input-width-140" style="padding:10px 0 5px 42px;">
                    <div class="btn-group" style="">
                        备件分类<br />
                        <select id="" name="" class="form-control">
                            <option>==请选择==</option>
                        </select>
                        &nbsp;
                    </div>
                    <div class="btn-group" style="">
                        备件编号<br /><input id="" name="" placeholder="" type="text" class="form-control required" /> &nbsp;
                    </div>
                    <div class="btn-group" style="">
                        备件名称<br /><input id="" name="" placeholder="" type="text" class="form-control required" /> &nbsp;
                    </div>
                    <div class="btn-group" style="">
                        参考图号<br /><input id="" name="" placeholder="" type="text" class="form-control required" /> &nbsp;
                    </div>
                </div>
                <div class="line-table input-width-140" style="padding:10px 0 5px 42px;">
                    备件列表：
                    <div class="btn-group" >
                        <input id="radio11" class="category" name="category" type="radio" value="未分供应商" checked="checked" /><label for="radio11" class="suffix">未分供应商</label> &nbsp;&nbsp;&nbsp;
                        <input id="radio12" class="category" name="category" type="radio" value="已分供应商" /><label for="radio12" class="suffix">已分供应商</label> &nbsp;&nbsp;&nbsp;
                    </div>
                    <label class="prefix">备件分类</label>
                    <select id="" name="" class="form-control">
                        <option>==请选择==</option>
                    </select>
                    &nbsp;
                    <div class="btn-group">
                        <a id="" class="btn btn-primary center-block btn-1" onclick=""><span class="glyphicon glyphicon-search"></span> 检索</a>
                    </div>
                </div>
                <div style="padding: 5px 0 5px 20px;">
                    <div id="grid111" style="width:100%">
                        <table id="gridList1"></table>
                        <div id="gridPager1"></div>
                    </div>
                    <div id="grid222" style="width: 100%">
                        <table id="gridList2"></table>
                        <div id="gridPager2"></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

